using GameServer.ShootingGame.WeaponsClasses;
using System;
namespace GameServer.ShootingGame.RenderableClasses
{
    public class RocketOrdinance : Ordinance
    {

        public RocketOrdinance()
        {
            LiveTime = 10000;
            defaultSpeed = 1.5;
        }

        public RocketOrdinance(GameObject owner, WeaponInfo weaponInfo)
            : base(owner, weaponInfo)
        {
            LiveTime = 10000;
            defaultSpeed = 1.5;
        }

        override protected void UpdateThrust()
        {
            //INEVITABLE CHANGE MARKER
            //The following line(s) of code will need to be changed in future.
            //Reason: SCROLLING MAP and memory storage of non-rendered off-screen objects (essential server function).
            if (owner is PlayerObject)
            {
                target.X = Convert.ToSingle((owner as PlayerObject).MouseX);
                target.Y = Convert.ToSingle((owner as PlayerObject).MouseY);
            }
            source.X = Convert.ToSingle(xPosition);
            source.Y = Convert.ToSingle(yPosition);


            base.UpdateThrust();
        }
        override public Ordinance Clone()
        {
            return new RocketOrdinance(owner, weaponInfo);
        }
    }
}
